import fsExtra from 'fs-extra'
import path from "node:path";
// import { execa, execaCommand, execaCommandSync } from 'execa'
const cwd = process.cwd()
const resolve = _path => path.resolve(cwd, _path);
console.log(resolve('./src/widget/card/setting.tsx'))
fsExtra.readFile(resolve('./src/widget/card/setting.tsx'), 'utf8').then(res => {
    let pattern = /"([0-9]+(?:\.[0-9a-z]+)*)"/i;
    const version = res.match(pattern)[1];
    console.log(res)
    res = res.replace(`"${version}"`, `"0.0.2"`);

    console.log(res)
    fsExtra.writeFile(resolve('./src/widget/card/setting.tsx'), res).then(res => {
        console.log(res)
    })
});
